import axios from '@/utils/axios'

export const getUserVO = (id: string): Promise<ApiResult<BaseUser>> => {
    return axios.get(`base/user/${id}`)
}

export const getUserPage = (pagination: Pagination, params: BaseUser): Promise<ApiResult<Page<BaseUserVO>>> => {
    return axios.get(`base/user/page/${pagination.page}/${pagination.pageSize}`, { params })
}

export const postOrPutUser = (user: BaseUser): Promise<ApiResult<null>> => {
    return axios.post(`base/user`, user)
}

export const deleteUser = (id: string): Promise<ApiResult<null>> => {
    return axios.delete(`base/user/${id}`)
}

export const putPassword = (passwordDto: PasswordDto): Promise<ApiResult<null>> => {
    return axios.put(`base/user/password`, passwordDto)
}

export const resetPassword = (id: string): Promise<ApiResult<null>> => {
    return axios.put(`base/user/password/reset/${id}`)
}

export const exportUserList = (): Promise<null> => {
    return axios.get(`base/user/export`)
}

